#ifndef __SP_THREAD_H_INCLUDED__
#define __SP_THREAD_H_INCLUDED__

typedef void (thread_fn)(void*);

#include "platform.h"

#ifdef SP_HAVE_WINDOWS
#include "windows.h"
#else
#include <pthread.h>
#endif

class thread
{
	public:
		inline thread()
		{

		}

		void start(thread_fn *tfn, void* arg);

		void stop();

		thread_fn *_tfn;
		void *_arg;
	private:
#ifdef SP_HAVE_WINDOWS
		HANDLE descriptor;
#else
		pthread_t descriptor;
#endif
};

#endif

